<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
        <a style="float: right;margin-right: 12%;margin-top: -10px;"
          	ui-sref="main.biz.rechargeRule.create" class="btn btn-sm btn-info">
            <i class="icon-user-follow m-r-sm text-md"></i>添加充值规则</a>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
                <form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group">


                        <div class="col-md-2">
                            <input ng-model="param.minMoney" class="form-control" placeholder="充值金额（小）" type="text"/>
                        </div>

                        <div class="col-md-2">
                            <input ng-model="param.maxMoney" class="form-control" placeholder="充值金额（大）" type="text"/>
                        </div>

                        <div class="col-md-2">
                            <select class="form-control" ng-model="param.enable" id="banEnable">
                                <option value="">--状态--</option>
                                <option value="Y">启用</option>
                                <option value="N">停用</option>
                            </select>
                        </div>

                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-primary" type="submit">查 询</button></label>
                        </div>
                       <!-- <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button type="button" class="ifc-btn btn-success" ng-click="batchoperation('Y')" >批量启用</button></label>
                        </div>
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button type="button" class="ifc-btn btn-danger"  ng-click="batchoperation('N')" >批量停用</button></label>
                        </div>-->
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label" >
                                <button type="button"  class="ifc-btn btn-success editSortBtn" ng-click="editSort($event)" >编辑排序</button>
                                <button type="button"  style="display: none" class="ifc-btn btn-success saveSortBtn" ng-click="saveSort($event)" >保存</button>
                            </label>
                        </div>
                    </div>
                </form>
            </div>
            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center sort">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>充值金额</th>
                        <th>赠送金额</th>
                        <th>比率</th>
                        <th>最低金额</th>
                        <th>最高金额</th>
                        <th>显示文本</th>
                        <th>排序号</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.records">
                        <td class="v-middle">{{item.ruleId}}</td>
                        <td class="v-middle">{{item.rechargeMoney}}</td>
                        <td class="v-middle">{{item.sendMoney}}</td>
                        <td class="v-middle">{{item.rate}}</td>
                        <td class="v-middle">{{item.minMoney}}</td>
                        <td class="v-middle">{{item.maxMoney}}</td>
                        <td class="v-middle">{{item.showText}}</td>
                        <td class="v-middle">{{item.sort}}</td>
                        <td class="v-middle" style="display:none;"><input type="tel" style="width:40px" value = "{{item.sort}}" onkeyup="if(!/^[0-9]+$/.test(this.value)) { this.value='';}"/></td>
                        <td class="v-middle">{{item.enable=='Y'?'启用':'停用'}}</td>
                        <td class="v-middle">
                            <a ui-sref="main.biz.rechargeRule.detail({id:item.ruleId})" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-edit m-r-xs text-sm"></i>详情</a>
                            <a ui-sref="main.biz.rechargeRule.update({id: item.ruleId})" class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>编辑</a>
                            <button type="button" ng-if="item.enable=='Y'" ng-click="operation(item.ruleId,'N')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>停用</button>
                            <button type="button" ng-if="item.enable=='N'" ng-click="operation(item.ruleId,'Y')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>启用</button>

                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->